var id = getSurfaceId(ev);
id = getEffectiveEventTarget (id);
var pos = getPositionsFromEvent(ev, id);
- sendInput ("m", [id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
+ sendInput ("m", [realWindowWithMouse, id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
}
function onMouseOver (ev) {
var pos = getPositionsFromEvent(ev, id);
windowWithMouse = id;
if (windowWithMouse != 0) {
- sendInput ("e", [id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_NORMAL]);
+ sendInput ("e", [realWindowWithMouse, id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_NORMAL]);
}
}
var pos = getPositionsFromEvent(ev, id);
if (id != 0) {
- sendInput ("l", [id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_NORMAL]);
+ sendInput ("l", [realWindowWithMouse, id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_NORMAL]);
}
realWindowWithMouse = 0;
windowWithMouse = 0;
if (windowWithMouse != id) {
if (windowWithMouse != 0) {
pos = getPositionsFromAbsCoord(lastX, lastY, windowWithMouse);
- sendInput ("l", [windowWithMouse, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_GRAB]);
+ sendInput ("l", [realWindowWithMouse, windowWithMouse, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_GRAB]);
}
pos = getPositionsFromAbsCoord(lastX, lastY, id);
- sendInput ("e", [id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_GRAB]);
+ sendInput ("e", [realWindowWithMouse, id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_GRAB]);
windowWithMouse = id;
}
if (realWindowWithMouse != windowWithMouse) {
if (windowWithMouse != 0) {
pos = getPositionsFromAbsCoord(lastX, lastY, windowWithMouse);
- sendInput ("l", [windowWithMouse, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_UNGRAB]);
+ sendInput ("l", [realWindowWithMouse, windowWithMouse, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_UNGRAB]);
}
if (realWindowWithMouse != 0) {
pos = getPositionsFromAbsCoord(lastX, lastY, realWindowWithMouse);
- sendInput ("e", [realWindowWithMouse, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_UNGRAB]);
+ sendInput ("e", [realWindowWithMouse, realWindowWithMouse, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, GDK_CROSSING_UNGRAB]);
}
windowWithMouse = realWindowWithMouse;
}
doGrab (id, false, ev.timeStamp, true);
var button = ev.button + 1;
lastState = lastState | getButtonMask (button);
- sendInput ("b", [id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, button]);
+ sendInput ("b", [realWindowWithMouse, id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, button]);
}
function onMouseUp (ev) {
var pos = getPositionsFromEvent(ev, id);
var button = ev.button + 1;
lastState = lastState & ~getButtonMask (button);
- sendInput ("B", [id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, button]);
+ sendInput ("B", [realWindowWithMouse, id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, button]);
if (grab.window != null && grab.implicit)
doUngrab(ev.timeStamp);
var dir = 0;
if (offset > 0)
dir = 1;
- sendInput ("s", [id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, dir]);
+ sendInput ("s", [realWindowWithMouse, id, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState, dir]);
return cancelEvent(ev);
}
case 'e': /* Enter */
display_broadway->last_x = message->pointer.root_x;
display_broadway->last_y = message->pointer.root_y;
+ display_broadway->real_mouse_in_toplevel =
+ g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
- window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.id));
+ window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_window_id));
/* TODO: Unset when it dies */
display_broadway->mouse_in_toplevel = window;
case 'l': /* Leave */
display_broadway->last_x = message->pointer.root_x;
display_broadway->last_y = message->pointer.root_y;
+ display_broadway->real_mouse_in_toplevel =
+ g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
- window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.id));
+ window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_window_id));
display_broadway->mouse_in_toplevel = NULL;
if (window)
case 'm': /* Mouse move */
display_broadway->last_x = message->pointer.root_x;
display_broadway->last_y = message->pointer.root_y;
+ display_broadway->real_mouse_in_toplevel =
+ g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
- window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.id));
+ window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_window_id));
if (window)
{
event = gdk_event_new (GDK_MOTION_NOTIFY);
case 'B':
display_broadway->last_x = message->pointer.root_x;
display_broadway->last_y = message->pointer.root_y;
+ display_broadway->real_mouse_in_toplevel =
+ g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
- window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.id));
+ window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_window_id));
if (window)
{
event = gdk_event_new (message->base.type == 'b' ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE);
case 's':
display_broadway->last_x = message->pointer.root_x;
display_broadway->last_y = message->pointer.root_y;
+ display_broadway->real_mouse_in_toplevel =
+ g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
- window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.id));
+ window = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_window_id));
if (window)
{
event = gdk_event_new (GDK_SCROLL);